<?php
namespace Plugin\Device\Schema;

use Plugin\Device\Model\RdDeviceSerial;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 录像机设备
 */
#[Schema(title: 'RdDeviceSerialSchema')]
class RdDeviceSerialSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: 'id', type: 'bigint')]
    public string $id;

    #[Property(property: 'rod_id', title: '装置ID', type: 'bigint')]
    public string $rod_id;

    #[Property(property: 'online', title: '1上线 2下线', type: 'int')]
    public string $online;

    #[Property(property: 'name', title: '名称', type: 'varchar')]
    public string $name;

    #[Property(property: 'voice_id', title: '名称语音ID', type: 'bigint')]
    public string $voice_id;

    #[Property(property: 'comply_id', title: '遵守语音ID', type: 'bigint')]
    public string $comply_id;

    #[Property(property: 'url', title: '流媒体地址', type: 'json')]
    public string $url;

    #[Property(property: 'device_serial', title: '设备序列号', type: 'varchar')]
    public string $device_serial;

    #[Property(property: 'channel_no', title: '通道号', type: 'varchar')]
    public string $channel_no;

    #[Property(property: 'type', title: '设备类型 1:枪机 2:球机', type: 'tinyint')]
    public string $type;

    #[Property(property: 'stand_id', title: '站点id', type: 'int')]
    public string $stand_id;

    #[Property(property: 'sort', title: '排序', type: 'int')]
    public string $sort;

    #[Property(property: 'remarks', title: '备注', type: 'varchar')]
    public string $remarks;

    #[Property(property: 'prompt_id', title: '提示语ID', type: 'bigint')]
    public string $prompt_id;

    #[Property(property: 'addr', title: '地址', type: 'varchar')]
    public string $addr;

    #[Property(property: 'created_at', title: 'created_at', type: 'timestamp')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'timestamp')]
    public string $updated_at;

    #[Property(property: 'deleted_at', title: 'deleted_at', type: 'timestamp')]
    public string $deleted_at;

    #[Property(property: 'created_by', title: '创建者', type: 'bigint')]
    public string $created_by;

    #[Property(property: 'updated_by', title: '更新者', type: 'bigint')]
    public string $updated_by;




    public function __construct(RdDeviceSerial $model)
    {
       $this->id = $model->id;
       $this->rod_id = $model->rod_id;
       $this->online = $model->online;
       $this->name = $model->name;
       $this->voice_id = $model->voice_id;
       $this->comply_id = $model->comply_id;
       $this->url = $model->url;
       $this->device_serial = $model->device_serial;
       $this->channel_no = $model->channel_no;
       $this->type = $model->type;
       $this->stand_id = $model->stand_id;
       $this->sort = $model->sort;
       $this->remarks = $model->remarks;
       $this->prompt_id = $model->prompt_id;
       $this->addr = $model->addr;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;
       $this->deleted_at = $model->deleted_at;
       $this->created_by = $model->created_by;
       $this->updated_by = $model->updated_by;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'rod_id' => $this->rod_id ,'online' => $this->online ,'name' => $this->name ,'voice_id' => $this->voice_id ,'comply_id' => $this->comply_id ,'url' => $this->url ,'device_serial' => $this->device_serial ,'channel_no' => $this->channel_no ,'type' => $this->type ,'stand_id' => $this->stand_id ,'sort' => $this->sort ,'remarks' => $this->remarks ,'prompt_id' => $this->prompt_id ,'addr' => $this->addr ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at ,'deleted_at' => $this->deleted_at ,'created_by' => $this->created_by ,'updated_by' => $this->updated_by];
    }
}